package com.bsb.biz.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bsb.base.mapper.BsbMsgMapper;
import com.bsb.base.model.BsbMsg;
import com.bsb.base.model.BsbMsgExample;

@Service
public class BsbMsgService{
	
	@Resource
	private BsbMsgMapper bsbMsgMapper;
	
	public void addBsbMsg(BsbMsg bsbMsg) {
		bsbMsgMapper.insertSelective(bsbMsg);
	}
	
	public void delBsbMsgById(Integer id) {
		bsbMsgMapper.deleteByPrimaryKey(id);
	}
	
	public void updateBsbMsg(BsbMsg bsbMsg) {
		bsbMsgMapper.updateByPrimaryKeySelective(bsbMsg);
	}
	
	public void updateBsbMsgByExample(BsbMsg bsbMsg,BsbMsgExample bsbMsgExample){
	    bsbMsgMapper.updateByExampleSelective(bsbMsg,bsbMsgExample);
	}
	
	public BsbMsg getBsbMsgById(Integer id) {
		return bsbMsgMapper.selectByPrimaryKey(id);
	}
	
	public List<BsbMsg> getPageBsbMsg(BsbMsgExample bsbMsgExample) {
		return bsbMsgMapper.selectPage(bsbMsgExample);
	}
	
	public int countBsbMsg(BsbMsgExample bsbMsgExample) {
		return bsbMsgMapper.countByExample(bsbMsgExample);
	}
	
	public List<BsbMsg> selectByExample(BsbMsgExample example){
	    return bsbMsgMapper.selectByExample(example);
	}
}
